<?php
/*********************************************************************************
 * SugarCRM is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
$dictionary['edanz_Jobs'] = array(
	'table'=>'edanz_jobs',
	'audited'=>true,
	'fields'=>array (
		  'order_date' => 
		  array (
			'required' => true,
			'name' => 'order_date',
			'vname' => 'LBL_ORDER_DATE',
			'type' => 'date',
			'audited' => true,
			'group' => 'order_date',
    		'enable_range_search' => true,
    		'options' => 'date_range_search_dom',
		  ),
		 'assigned_user_id' => 
		  array (
		    'required' => true,
		    'name' => 'assigned_user_id',
		    'vname' => 'LBL_ASSIGNED_TO_ID',
		    'type' => 'id',
		    'massupdate' => 0,
		    'comments' => '',
		    'help' => '',
		    'importable' => 'true',
		    'duplicate_merge' => 'disabled',
		    'duplicate_merge_dom_value' => 0,
		    'audited' => true,
		    'reportable' => true,
		    'len' => 36,
		    'size' => '20',
		  ),
		'assigned_user_name' => 
		  array (
		    'required' => true,
		    'source' => 'non-db',
		    'name' => 'assigned_user_name',
		    'vname' => 'LBL_ASSIGNED_TO_NAME',
		    'type' => 'relate',
		    'massupdate' => 0,
		    'comments' => '',
		    'help' => '',
		    'importable' => 'true',
		    'duplicate_merge' => 'disabled',
		    'duplicate_merge_dom_value' => '0',
		    'audited' => true,
		    'reportable' => true,
		    'len' => '255',
		    'size' => '20',
		    'id_name' => 'assigned_user_id',
		    'ext2' => 'Users',
		    'module' => 'Users',
		    'rname' => 'name',
		    'quicksearch' => 'enabled',
		    'studio' => 'visible',
		  ),
		  'password' => 
		  array (
			'required' => true,
			'name' => 'password',
			'vname' => 'LBL_PASSWORD',
			'type' => 'varchar',
			'massupdate' => 0,
			'comments' => '',
			'help' => '',
			'importable' => 'true',
			'duplicate_merge' => 'disabled',
			'duplicate_merge_dom_value' => '0',
			'audited' => true,
			'reportable' => true,
			'len' => '255',
			'size' => '20',
		  ),
		  'origin_system' => 
		  array (
			'required' => false,
			'name' => 'origin_system',
			'vname' => 'LBL_ORIGIN_SYSTEM',
			'type' => 'enum',
			'massupdate' => 0,
			'comments' => '',
			'help' => '',
			'importable' => 'true',
			'duplicate_merge' => 'disabled',
			'duplicate_merge_dom_value' => '0',
			'audited' => false,
			'reportable' => true,
			'len' => '255',
			'size' => '20',
		  ),
		  'r2_job_id' => 
		  array (
			'required' => false,
			'name' => 'r2_job_id',
			'vname' => 'LBL_R2_JOB_ID',
			'type' => 'enum',
			'massupdate' => 0,
			'comments' => '',
			'help' => '',
			'importable' => 'true',
			'duplicate_merge' => 'disabled',
			'duplicate_merge_dom_value' => '0',
			'audited' => false,
			'reportable' => true,
			'len' => '255',
			'size' => '20',
			'options' => 'origin_system_list',
		  ),
		  'securitygroup' => 
		  array (
			'required' => true,
			'name' => 'securitygroup',
			'vname' => 'LBL_SECURITYGROUP',
			'type' => 'enum',
			'massupdate' => 0,
			'comments' => '',
			'help' => '',
			'source' => 'non-db',
			'importable' => 'true',
			'duplicate_merge' => 'disabled',
			'duplicate_merge_dom_value' => '0',
			'audited' => false,
			'reportable' => true,
			'len' => '255',
			'size' => '20',
			'options' => 'security_group_list',
		  ),
		  'deliverables' => 
		  array (
			  'name' => 'deliverables',
			  'vname' => 'LBL_SUBPANEL_DELIVERABLES',
			  'type' => 'link',
			  'relationship' => 'job_deliverables',
			  'source' => 'non-db',
		  ),
		  'emails' => array (
			'name' => 'emails',
			'type' => 'link',
			'relationship' => 'emails_jobs_rel',
			'source'=>'non-db',
			'vname'=>'LBL_EMAILS',
			'unified_search'=>true,
		),
),
	'relationships'=>array (
		'job_deliverables' => array(
			'lhs_module'=> 'edanz_Jobs',
			'lhs_table'=> 'edanz_jobs',
			'lhs_key' => 'id',
			'rhs_module'=> 'edanz_Deliverables' ,
			'rhs_table'=> 'edanz_deliverables',
			'rhs_key' => 'job_id',
			'relationship_type'=>'one-to-many'
		),
		'emails_jobs_rel' => array(
			'lhs_module'=> 'edanz_Jobs', 
			'lhs_table'=> 'edanz_jobs', 
			'lhs_key' => 'id',
			'rhs_module'=> 'Emails', 
			'rhs_table'=> 'emails', 
			'rhs_key' => 'parent_id',
			'relationship_type'=>'one-to-many', 
			'relationship_role_column'=>'parent_type',
			'relationship_role_column_value'=>'edanz_Jobs'
		),
		
	),
	'optimistic_locking'=>true,
);
if (!class_exists('VardefManager')){
        require_once('include/SugarObjects/VardefManager.php');
}
VardefManager::createVardef('edanz_Jobs','edanz_Jobs', array('basic','assignable'));
$dictionary['edanz_Jobs']['fields']['name']['audited'] =  true;

// Security Suite Groups
global $beanList;
if (isset($beanList['SecurityGroups'])) {
	$dictionary["edanz_Jobs"]["fields"]["securitygroups_edanz_jobs"] = array (
	  'name' => 'securitygroups_edanz_jobs',
	  'type' => 'link',
	  'relationship' => 'securitygroups_edanz_jobs',
	  'source' => 'non-db',
	  'vname' => 'LBL_SECURITYGROUPS_SUBPANEL_TITLE',
	);
	$dictionary["edanz_Jobs"]["relationships"]["securitygroups_edanz_jobs"] = array (
		'lhs_module' => 'SecurityGroups',
		'lhs_table' => 'securitygroups',
		'lhs_key' => 'id',
		'rhs_module' => 'edanz_Jobs',
		'rhs_table' => 'edanz_jobs',
		'rhs_key' => 'id',
		'join_table' => 'securitygroups_records',
		'join_key_lhs' => 'securitygroup_id',
		'join_key_rhs' => 'record_id',
		'relationship_type' => 'many-to-many',
		'relationship_role_column' => 'module',
		'relationship_role_column_value' => 'edanz_Jobs',
	);
}